<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       div{
        width: 580px;
        padding: 20px;
        border: 1px solid #000;
        justify-self: center;
       }
       div img{
        border-radius: 10px;
        border: 2px solid blue;
        margin: 5px;
        width: 100px;
       }
    </style>
</head>
<body>
   <!-- <div>
    <img src="../images/1.webp">
    <img src="../images/1.webp">
    <img src="../images/1.webp">
    <img src="../images/1.webp">
    <img src="../images/1.webp">
   </div> -->
   <script>
    document.write(`<div>`)
    let t = +prompt('请输入1-20之间的数字')
        for(i=1;i<=t;i++){
            if(t>20){
            alert('输入错误,请输入1-20的数!')   
            break
        }
        document.write(`<img src="../images/${i}.webp">`)
    }
    document.write(`</div>`)
   </script>
</body>
</html>